home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / QDDVX102.ZIP / contrib / dvx / inc / x11 / intrinsc.h < prev    next >
Text File  |  1993-07-15  |  7KB  |  207 lines

  1. /*
  2. * $XConsortium: IntrinsicI.h,v 1.42 90/07/26 10:05:52 swick Exp $
  3. * $oHeader: IntrinsicI.h,v 1.5 88/08/31 16:21:08 asente Exp $
  4. */
  5.  
  6. /***********************************************************
  7. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  8. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  9.  
  10.                         All Rights Reserved
  11.  
  12. Permission to use, copy, modify, and distribute this software and its 
  13. documentation for any purpose and without fee is hereby granted, 
  14. provided that the above copyright notice appear in all copies and that
  15. both that copyright notice and this permission notice appear in 
  16. supporting documentation, and that the names of Digital or MIT not be
  17. used in advertising or publicity pertaining to distribution of the
  18. software without specific, written prior permission.  
  19.  
  20. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  21. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  22. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  23. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  24. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  25. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  26. SOFTWARE.
  27.  
  28. ******************************************************************/
  29.  
  30. #ifndef _XtintrinsicI_h
  31. #define _XtintrinsicI_h
  32.  
  33. #include <X11/Xtos.h> /* Was "Xtos.h" POHC 90/12/18 */
  34. #include <X11/IntrinsP.h> /* Shortened "IntrinsicP.h" POHC 90/10/21 */
  35.  
  36. #include <X11/Object.h> /* Was "Object.h". POHC 90/12/18 */
  37. #include <X11/RectObj.h> /* Was "RectObj.h". POHC 90/12/18 */
  38. #include <X11/ObjectP.h> /* Was "ObjectP.h". POHC 90/12/18 */
  39. #include <X11/RectObjP.h> /* Was "RectObjP.h". POHC 90/12/18 */
  40.  
  41. #include <X11/TranslateI.h> /* Was "TranslateI.h". POHC 90/12/18 */
  42. #include <X11/CallbackI.h> /* Was "CallbackI.h". POHC 90/12/18 */
  43. #include <X11/ComposiI.h> /* Shortened "CompositeI.h" POHC 90/10/21 */
  44. #include <X11/ConvertI.h> /* Was "ConvertI.h". POHC 90/12/18 */
  45. #include <X11/EventI.h> /* Was "EventI.h". POHC 90/12/18 */
  46. #include <X11/PassivGraI.h> /* Was "PassivGraI.h". POHC 91/03/06 */
  47. #include <X11/InitialI.h> /* Was "InitialI.h". POHC 90/12/18 */
  48. #include <X11/ResourceI.h> /* Was "ResourceI.h". POHC 90/12/18 */
  49.  
  50.  
  51. #define RectObjClassFlag    0x02
  52. #define WidgetClassFlag        0x04
  53. #define CompositeClassFlag    0x08
  54. #define ConstraintClassFlag    0x10
  55. #define ShellClassFlag        0x20
  56. #define WMShellClassFlag    0x40
  57. #define TopLevelClassFlag    0x80
  58.  
  59. /*
  60.  * The following macros, though very handy, are not suitable for
  61.  * IntrinsicP.h as they violate the rule that arguments are to
  62.  * be evaluated exactly once.
  63.  */
  64.  
  65. #define XtDisplayOfObject(object) \
  66.     ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
  67.      ->core.screen->display)
  68.  
  69. #define XtScreenOfObject(object) \
  70.     ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
  71.      ->core.screen)
  72.  
  73. #define XtWindowOfObject(object) \
  74.     ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
  75.      ->core.window)
  76.  
  77. #define XtIsManaged(object) \
  78.     (XtIsRectObj(object) ? (object)->core.managed : False)
  79.  
  80. #define XtIsSensitive(object) \
  81.     (XtIsRectObj(object) ? ((object)->core.sensitive && \
  82.                 (object)->core.ancestor_sensitive) : False)
  83.  
  84.  
  85. /****************************************************************
  86.  *
  87.  * Byte utilities
  88.  *
  89.  ****************************************************************/
  90.  
  91. #ifndef MSDOS /* POHC 90/10/21 */
  92. extern void bcopy();
  93. extern void bzero();
  94. extern int bcmp();
  95. #else /* MSDOS */
  96. #if !defined(__GNUC__) && !defined(__SALFORD__)
  97. #define bcopy(a,b,c)    memcpy(b,a,c)
  98. #define bcmp(a,b,c)     memcmp(a,b,c)
  99. #define bzero(a,b)      memset(a,0,b)
  100. #endif
  101. #endif /* MSDOS */
  102.  
  103. /* If the alignment characteristics of your machine are right, these may be
  104.    faster */
  105.  
  106. #ifdef UNALIGNED
  107.  
  108. #define XtBCopy(src, dst, size)                    \
  109.     if (size == sizeof(int))                    \
  110.     *((int *) (dst)) = *((int *) (src));            \
  111.     else if (size == sizeof(char))                \
  112.     *((char *) (dst)) = *((char *) (src));            \
  113.     else if (size == sizeof(short))                \
  114.     *((short *) (dst)) = *((short *) (src));        \
  115.     else                            \
  116.     bcopy((char *) (src), (char *) (dst), (int) (size));
  117.  
  118. #define XtBZero(dst, size)                    \
  119.     if (size == sizeof(int))                    \
  120.     *((int *) (dst)) = 0;                    \
  121.     else                            \
  122.     bzero((char *) (dst), (int) (size));
  123.  
  124. #define XtBCmp(b1, b2, size)                    \
  125.     (size == sizeof(int) ?                    \
  126.     *((int *) (b1)) != *((int *) (b2))            \
  127.     :   bcmp((char *) (b1), (char *) (b2), (int) (size))    \
  128.     )
  129.  
  130. #else
  131.  
  132. #define XtBCopy(src, dst, size)        \
  133.     bcopy((char *) (src), (char *) (dst), (int) (size));
  134.  
  135. #define XtBZero(dst, size) bzero((char *) (dst), (int) (size));
  136.  
  137. #define XtBCmp(b1, b2, size) bcmp((char *) (b1), (char *) (b2), (int) (size))
  138.  
  139. #endif
  140.  
  141.  
  142. /****************************************************************
  143.  *
  144.  * Stack cache allocation/free
  145.  *
  146.  ****************************************************************/
  147.  
  148. #define XtStackAlloc(size, stack_cache_array)     \
  149.     (size <= sizeof(stack_cache_array)          \
  150.     ?  (XtPointer)stack_cache_array          \
  151.     :  XtMalloc((unsigned) size))
  152.  
  153. #define XtStackFree(pointer, stack_cache_array) \
  154.     if ((pointer) != ((XtPointer)stack_cache_array)) XtFree(pointer); else
  155.  
  156. /***************************************************************
  157.  *
  158.  * Filename defines
  159.  *
  160.  **************************************************************/
  161.  
  162. /* used by XtResolvePathname */
  163. #ifndef XFILESEARCHPATHDEFAULT
  164. #ifdef MSDOS /* POHC 90/10/21 */
  165. #define XFILESEARCHPATHDEFAULT "~\\%L\\%T\\%N%S;~\\%l\\%T\\%N%S;~\\%T\\%N%S"
  166. #else /* !MSDOS */
  167. #define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
  168. #endif /* !MSDOS */
  169. #endif
  170.  
  171. /* the following two were both "X Toolkit " prior to R4 */
  172. #ifndef XTERROR_PREFIX
  173. #define XTERROR_PREFIX ""
  174. #endif
  175.  
  176. #ifndef XTWARNING_PREFIX
  177. #define XTWARNING_PREFIX ""
  178. #endif
  179.  
  180. #ifndef ERRORDB
  181. #ifdef MSDOS /* POHC 90/10/21 */
  182. #define ERRORDB "~\\lib\\X11\\XtErrorDB"
  183. #else /* !MSDOS */
  184. #define ERRORDB "/usr/lib/X11/XtErrorDB"
  185. #endif /* !MSDOS */
  186. #endif
  187.  
  188. extern String XtCXtToolkitError;
  189.  
  190. extern void _XtAllocError(
  191. #if NeedFunctionPrototypes
  192.     String    /* alloc_type */
  193. #endif
  194. );
  195.  
  196. extern XtGeometryResult _XtMakeGeometryRequest(
  197. #if NeedFunctionPrototypes
  198.     Widget         /* widget */,
  199.     XtWidgetGeometry*    /* request */,
  200.     XtWidgetGeometry*    /* reply_return */,
  201.     Boolean*        /* clear_rect_obj */
  202. #endif
  203. );
  204.  
  205. #endif /* _XtintrinsicI_h */
  206. /* DON'T ADD STUFF AFTER THIS #endif */
  207.